Tuviv
Tuviv is a library for building terminal user interfaces (TUIs) with
rust with a heavy focus on layout. Tuviv does not come with as many
widgets as, say, tui-rs, but rather
contains many more widgets based on layout: specifically a
Flexbox
,
and a Grid
,
along with others.
The purpose of this library is to significantly ease creating layouts, which is mildly clunky with tui-rs: such as the fact that you cannot center text vertically (#396) - but also wider-scale things - such as the lack of a flexbox or a grid.
Examples
Create a Buffer And Render a Widget
use ;
use ;
use ;
Create More Complicated Widget Trees
Tuviv uses a builder pattern so more complicated widgets can be created easily:
use *;
// Create a grid with progressbars:
//
// ╭───────────────╮
// │CPU █▌────────│
// │MEM ███▌──────│
// │GPU ─────CO o │
// ╰───────────────╯
let grid = new
.template_rows
.template_columns
.column_gap
.auto_child
.auto_child
.auto_child
.auto_child
.auto_child
.auto_child
.to_box_sizing
.border
.centered;